package edu.ecu.seng6270.goa.pss.unittests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import edu.ecu.seng6270.goa.ropa.Order;
import edu.ecu.seng6270.goa.ropa.OrderItem;

public class TestOrder {
	private static final String UID = "abc123";
	
	public static void main(String args[]) {
	      org.junit.runner.JUnitCore.main("edu.ecu.seng6270.goa.pss.unittests.TestOrder");
	    }

	@Test
	public void testOrder() {
		Order o = new Order(UID);

		// See if we getback the same UID
		assertEquals(UID, o.getUserID());
	}

	@Test
	public void testInsertOrderItem() {
		Order o = new Order(UID);
	
		// TC-1 Insert a valid item
		assertEquals(true, o.insertOrderItem(new OrderItem()));
		
		// Get the item back, check a value
		OrderItem oi = o.getMyItemList().get(0);
		assertEquals(1, oi.getMySize());
		assertEquals(1, oi.getMyQuantity());

		// TC-2 Insert an INVALID item
		assertEquals(false, o.insertOrderItem(new OrderItem(3,3,1,1,1)));
		
		// TC-3 For BRANCH coverage
		o.getMyItemList().clear();
		o.setIsExpress(true);
		assertEquals(true, o.insertOrderItem(new OrderItem()));
		
	}


	@Test
	public void exerciseTheGettersAndSetters() {
		Order o = new Order(UID);
		o.insertOrderItem(new OrderItem(1,1,1,100,1));
		
		// TC-1 Express Getter
		o.setIsExpress(false);
		assertEquals(false, o.getIsExpress());
		o.setIsExpress(true);
		assertEquals(true, o.getIsExpress());
		
		// TC-2 PromoEligible
		assertEquals(false, o.getPromoEligible());
		o.validatePromoCode("N56M2");
		o.setPromoEligible(true);
		assertEquals(true, o.getPromoEligible());
		assertEquals("N56M2", o.getPromoCode());
		
		// TC-3 GetVolumeDiscount
		o.calculateOrderPrice();
		assertEquals(2, o.getVolumeDiscount(), 0.001);
		
	}
	
	
	@Test
	public void testValidateOrder() {
		Order o = new Order(UID);

		//TC-0 Invalid if no order items
		assertEquals("Order not valid without order item", false, o.validateOrder()); // No Order Item yet

		//TC-1 Default order with default item is Custom
		o.insertOrderItem(new OrderItem());
		assertEquals(false, o.getIsExpress());
		assertEquals(true, o.validateOrder());
		
		//TC-2 Express order
		o.setIsExpress(true);
		assertEquals(true, o.validateOrder());
		assertEquals(true, o.getIsExpress());
		
		//TC-3 Boundary OI Quantity
		o.getMyItemList().get(0).setMyQuantity(100);
		assertEquals(true, o.validateOrder());

		//TC-4 Invalid Boundary OI Quantity
		o.getMyItemList().get(0).setMyQuantity(101);
		assertEquals(false, o.validateOrder());
		
		//TC-5 Set user ID to null (INVALID)
		o.getMyItemList().get(0).setMyQuantity(45);
		o.setUserID(null);
		assertEquals(false, o.validateOrder());
		
		//TC-6 for BRANCH coverage
		o.setUserID(UID);
		o.getMyItemList().clear();
		o.setIsExpress(true);
		assertEquals(false, o.validateOrder());
		
	}

	@Test
	public void testSerialization() {
		// TC-1
		Order o = new Order(UID);
		assertEquals("{\"isExpress\":false,\"promoEligible\":false,\"userID\":\"abc123\",\"nonDiscountedPrice\":0.0,\"volumeDiscount\":0.0,\"discountedPrice\":0.0,\"promoDiscount\":2.0,\"myItemList\":[]}", o.serialzeToJSON());
	}
	
	
	@Test
	public void canExpressHaveMultipleItems() {
		Order o = new Order(UID);
		o.insertOrderItem(new OrderItem());
		
		o.setIsExpress(true);
		assertEquals(true, o.validateOrder());
		
		//Try to add multiple items to Express Order
		o.insertOrderItem(new OrderItem());
		o.insertOrderItem(new OrderItem());
		o.insertOrderItem(new OrderItem());

		//TC-1 -- There should still only be one item
		assertEquals(1, o.getMyItemList().size());
	}
	
	@Test
	public void testValidatePromoCode() {
		Order o = new Order(UID);
		o.insertOrderItem(new OrderItem(1,1,1,100,1));
		assertEquals(true, o.validateOrder());
		
		// TC-1 null value is INVALID
		assertEquals(false, o.validatePromoCode(null));
		
		// TC-2 proper value is provided
		assertEquals(true, o.validatePromoCode("N56M2"));

		// TC-3 wrong but non-null value is provided
		assertEquals(false, o.validatePromoCode("Promo Code"));
		
	}
	

	@Test
	public void testCalculateExpressOrderPriceSize4x6() {
		Order o = new Order(UID);
		o.insertOrderItem(new OrderItem());
		
		// TC-0 Item is created with default values
		o.setIsExpress(true);
		o.calculateOrderPrice();
		assertEquals("1 print all standard", 0.14, o.getNonDiscountedPrice(), 0.001);
		

		// Get the order item so that we may manipulate it's values
		OrderItem oi = o.getMyItemList().get(0);

		//TC-1 - Attempt Negative Quantity (Boundary)
		oi.setMyQuantity(-1);
		o.calculateOrderPrice();
		assertEquals("Error Negative Quantity", -1, o.getNonDiscountedPrice(), 0.001);
		
		//TC-2 - Attempt 0 Quantity (Boundary)
		oi.setMyQuantity(0);
		o.calculateOrderPrice();
		assertEquals("Error 0 Quantity", -1, o.getNonDiscountedPrice(), 0.001);

		//TC-3 - Attempt Quantity of 1 (Boundary)
		oi.setMyQuantity(1);
		o.calculateOrderPrice();
		assertEquals("1 standard print", 0.14, o.getNonDiscountedPrice(), 0.001);

		//TC-4 - Attempt Quantity of 30
		oi.setMyQuantity(30);
		o.calculateOrderPrice();
		assertEquals("30 standard print", 4.2, o.getNonDiscountedPrice(), 0.001);
		
		//TC-5 - Attempt Quantity of 50 (Boundary)
		oi.setMyQuantity(50);
		o.calculateOrderPrice();
		assertEquals("50 standard print", 7, o.getNonDiscountedPrice(), 0.001);

		//TC-6 - Attempt Quantity of 51 (Boundary)
		oi.setMyQuantity(51);
		o.calculateOrderPrice();
		assertEquals("51 standard print", 7.12, o.getNonDiscountedPrice(), 0.001);

		//TC-7 - Attempt Quantity of 68
		oi.setMyQuantity(68);
		o.calculateOrderPrice();
		assertEquals("68 standard print", 9.16, o.getNonDiscountedPrice(), 0.001);
		
		//TC-8 - Attempt Quantity of 74 (Boundary)
		oi.setMyQuantity(74);
		o.calculateOrderPrice();
		assertEquals("74 standard print", 9.88, o.getNonDiscountedPrice(), 0.001);

		//TC-9 - Attempt Quantity of 75 (Boundary)
		oi.setMyQuantity(75);
		o.calculateOrderPrice();
		assertEquals("75 standard print", 10, o.getNonDiscountedPrice(), 0.001);
		
		//TC-10 - Attempt Quantity of 76 (Boundary)
		oi.setMyQuantity(76);
		o.calculateOrderPrice();
		assertEquals("76 standard print", 10.10, o.getNonDiscountedPrice(), 0.001);
		
		//TC-11 - Attempt Quantity of 89 
		oi.setMyQuantity(89);
		o.calculateOrderPrice();
		assertEquals("89 standard print", 11.4, o.getNonDiscountedPrice(), 0.001);
	
		//TC-12 - Attempt Quantity of 99 (Boundary) 
		oi.setMyQuantity(99);
		o.calculateOrderPrice();
		assertEquals("99 standard print", 12.4, o.getNonDiscountedPrice(), 0.001);

		//TC-13 - Attempt Quantity of 100 (Boundary) 
		oi.setMyQuantity(100);
		o.calculateOrderPrice();
		assertEquals("100 standard print", 12.5, o.getNonDiscountedPrice(), 0.001);

		//TC-14 - Attempt Quantity of 101 (Boundary) 
		oi.setMyQuantity(101);
		o.calculateOrderPrice();
		assertEquals("ERROR 101 standard print", -1, o.getNonDiscountedPrice(), 0.001);

		//TC-15 - Attempt Quantity of 65 Matte Finish 
		oi.setMyQuantity(65);
		oi.setMyFinish(2);
		o.calculateOrderPrice();
		assertEquals("65 Matte 4x6 print", 10.10, o.getNonDiscountedPrice(), 0.001);

		//TC-16 - Attempt Quantity of 65 Matte Finish 1-Hour 
		oi.setMyQuantity(65);
		oi.setMyFinish(2);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("65 Matte 4x6 1-hour print", 11.60, o.getNonDiscountedPrice(), 0.001);

		//TC-17 - Attempt Quantity of 65 Glossy Finish 1-Hour 
		oi.setMyQuantity(65);
		oi.setMyFinish(1);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("65 Glossy 4x6 1-hour print", 10.30, o.getNonDiscountedPrice(), 0.001);
	}


	@Test
	public void testCalculateExpressOrderPriceSize5x7() {
		Order o = new Order(UID);
		o.insertOrderItem(new OrderItem());
		o.setIsExpress(true);

		// Get the order item so that we may manipulate it's values
		OrderItem oi = o.getMyItemList().get(0);

		// Set size to 5x7
		oi.setMySize(2);
		o.calculateOrderPrice();
		assertEquals("1 print all 5x7 standard", 0.34, o.getNonDiscountedPrice(), 0.001);
		
		//TC-1 - Attempt Negative Quantity (Boundary)
		oi.setMyQuantity(-1);
		o.calculateOrderPrice();
		assertEquals("Error Negative Quantity", -1, o.getNonDiscountedPrice(), 0.001);
		
		//TC-2 - Attempt 0 Quantity (Boundary)
		oi.setMyQuantity(0);
		o.calculateOrderPrice();
		assertEquals("Error 0 Quantity", -1, o.getNonDiscountedPrice(), 0.001);

		//TC-3 - Attempt Quantity of 1 (Boundary)
		oi.setMyQuantity(1);
		o.calculateOrderPrice();
		assertEquals("1 5x7 standard print", 0.34, o.getNonDiscountedPrice(), 0.001);

		//TC-4 - Attempt Quantity of 30
		oi.setMyQuantity(30);
		o.calculateOrderPrice();
		assertEquals("30 5x7 standard print", 10.2, o.getNonDiscountedPrice(), 0.001);
		
		//TC-5 - Attempt Quantity of 50 (Boundary)
		oi.setMyQuantity(50);
		o.calculateOrderPrice();
		assertEquals("50 5x7 standard print", 17, o.getNonDiscountedPrice(), 0.001);

		//TC-6 - Attempt Quantity of 51 (Boundary)
		oi.setMyQuantity(51);
		o.calculateOrderPrice();
		assertEquals("51 5x7 standard print", 17.31, o.getNonDiscountedPrice(), 0.001);

		//TC-7 - Attempt Quantity of 68
		oi.setMyQuantity(68);
		o.calculateOrderPrice();
		assertEquals("68 5x7 standard print", 22.58, o.getNonDiscountedPrice(), 0.001);
		
		//TC-8 - Attempt Quantity of 74 (Boundary)
		oi.setMyQuantity(74);
		o.calculateOrderPrice();
		assertEquals("74 5x7 standard print", 24.44, o.getNonDiscountedPrice(), 0.001);

		//TC-9 - Attempt Quantity of 75 (Boundary)
		oi.setMyQuantity(75);
		o.calculateOrderPrice();
		assertEquals("75 5x7 standard print", 24.75, o.getNonDiscountedPrice(), 0.001);
		
		//TC-10 - Attempt Quantity of 76 (Boundary)
		oi.setMyQuantity(76);
		o.calculateOrderPrice();
		assertEquals("76 5x7 standard print", 25.03, o.getNonDiscountedPrice(), 0.001);
		
		//TC-11 - Attempt Quantity of 89 
		oi.setMyQuantity(89);
		o.calculateOrderPrice();
		assertEquals("89 5x7 standard print", 28.67, o.getNonDiscountedPrice(), 0.001);
	
		//TC-12 - Attempt Quantity of 99 (Boundary) 
		oi.setMyQuantity(99);
		o.calculateOrderPrice();
		assertEquals("99 5x7 standard print", 31.47, o.getNonDiscountedPrice(), 0.001);

		//TC-13 - Attempt Quantity of 100 (Boundary) 
		oi.setMyQuantity(100);
		o.calculateOrderPrice();
		assertEquals("100 5x7 standard print", 31.75, o.getNonDiscountedPrice(), 0.001);

		//TC-14 - Attempt Quantity of 101 (Boundary) 
		oi.setMyQuantity(101);
		o.calculateOrderPrice();
		assertEquals("ERROR 101 5x7 standard print", -1, o.getNonDiscountedPrice(), 0.001);

		//TC-15 - Attempt Quantity of 65 Matte Finish 
		oi.setMyQuantity(65);
		oi.setMyFinish(2);
		o.calculateOrderPrice();
		assertEquals("65 Matte 5x7 print", 23.6, o.getNonDiscountedPrice(), 0.001);

		//TC-16 - Attempt Quantity of 65 Matte Finish 1-Hour 
		oi.setMyQuantity(65);
		oi.setMyFinish(2);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("65 Matte 5x7 1-hour print", 25.10, o.getNonDiscountedPrice(), 0.001);

		//TC-17 - Attempt Quantity of 65 Glossy Finish 1-Hour 
		oi.setMyQuantity(65);
		oi.setMyFinish(1);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("65 Glossy 5x7 1-hour print", 23.15, o.getNonDiscountedPrice(), 0.001);

	}

	
	@Test
	public void testCalculateExpressOrderPriceSize8x10() {
		Order o = new Order(UID);
		o.insertOrderItem(new OrderItem());
		o.setIsExpress(true);

		// Get the order item so that we may manipulate it's values
		OrderItem oi = o.getMyItemList().get(0);

		// Set size to 8x10
		oi.setMySize(3);
		o.calculateOrderPrice();
		assertEquals("1 print all 8x10 standard", 0.68, o.getNonDiscountedPrice(), 0.001);
		
		//TC-1 - Attempt Negative Quantity (Boundary)
		oi.setMyQuantity(-1);
		o.calculateOrderPrice();
		assertEquals("Error Negative Quantity", -1, o.getNonDiscountedPrice(), 0.001);
		
		//TC-2 - Attempt 0 Quantity (Boundary)
		oi.setMyQuantity(0);
		o.calculateOrderPrice();
		assertEquals("Error 0 Quantity", -1, o.getNonDiscountedPrice(), 0.001);

		//TC-3 - Attempt Quantity of 1 (Boundary)
		oi.setMyQuantity(1);
		o.calculateOrderPrice();
		assertEquals("1 8x10 standard print", 0.68, o.getNonDiscountedPrice(), 0.001);

		//TC-4 - Attempt Quantity of 30
		oi.setMyQuantity(30);
		o.calculateOrderPrice();
		assertEquals("30 8x10 standard print", 20.4, o.getNonDiscountedPrice(), 0.001);
		
		//TC-5 - Attempt Quantity of 50 (Boundary)
		oi.setMyQuantity(50);
		o.calculateOrderPrice();
		assertEquals("50 8x10 standard print", 34, o.getNonDiscountedPrice(), 0.001);

		//TC-6 - Attempt Quantity of 51 (Boundary)
		oi.setMyQuantity(51);
		o.calculateOrderPrice();
		assertEquals("51 8x10 standard print", 34.64, o.getNonDiscountedPrice(), 0.001);

		//TC-7 - Attempt Quantity of 68
		oi.setMyQuantity(68);
		o.calculateOrderPrice();
		assertEquals("68 8x10 standard print", 45.52, o.getNonDiscountedPrice(), 0.001);
		
		//TC-8 - Attempt Quantity of 74 (Boundary)
		oi.setMyQuantity(74);
		o.calculateOrderPrice();
		assertEquals("74 8x10 standard print", 49.36, o.getNonDiscountedPrice(), 0.001);

		//TC-9 - Attempt Quantity of 75 (Boundary)
		oi.setMyQuantity(75);
		o.calculateOrderPrice();
		assertEquals("75 8x10 standard print", 50, o.getNonDiscountedPrice(), 0.001);
		
		//TC-10 - Attempt Quantity of 76 (Boundary)
		oi.setMyQuantity(76);
		o.calculateOrderPrice();
		assertEquals("76 8x10 standard print", 50.60, o.getNonDiscountedPrice(), 0.001);
		
		//TC-11 - Attempt Quantity of 89 
		oi.setMyQuantity(89);
		o.calculateOrderPrice();
		assertEquals("89 8x10 standard print", 58.4, o.getNonDiscountedPrice(), 0.001);
	
		//TC-12 - Attempt Quantity of 99 (Boundary) 
		oi.setMyQuantity(99);
		o.calculateOrderPrice();
		assertEquals("99 8x10 standard print", 64.40, o.getNonDiscountedPrice(), 0.001);

		//TC-13 - Attempt Quantity of 100 (Boundary) 
		oi.setMyQuantity(100);
		o.calculateOrderPrice();
		assertEquals("100 8x10 standard print", 65, o.getNonDiscountedPrice(), 0.001);

		//TC-14 - Attempt Quantity of 101 (Boundary) 
		oi.setMyQuantity(101);
		o.calculateOrderPrice();
		assertEquals("ERROR 101 8x10 standard print", -1, o.getNonDiscountedPrice(), 0.001);

		//TC-15 - Attempt Quantity of 65 Matte Finish 
		oi.setMyQuantity(65);
		oi.setMyFinish(2);
		o.calculateOrderPrice();
		assertEquals("65 Matte 8x10 print", 46.2, o.getNonDiscountedPrice(), 0.001);

		//TC-16 - Attempt Quantity of 65 Matte Finish 1-Hour 
		oi.setMyQuantity(65);
		oi.setMyFinish(2);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("65 Matte 8x10 1-hour print", 47.7, o.getNonDiscountedPrice(), 0.001);

		//TC-17 - Attempt Quantity of 65 Glossy Finish 1-Hour 
		oi.setMyQuantity(65);
		oi.setMyFinish(1);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("65 Glossy 8x10 1-hour print", 45.1, o.getNonDiscountedPrice(), 0.001);

	}

	
	
	
	
	@Test
	public void testCalculateCustomOrderPrice() {
		Order o = new Order(UID);
		o.setIsExpress(false);
		OrderItem oi = new OrderItem();
		
		// TC-0 Check price with no items (INVALID)
		o.calculateOrderPrice();
		assertEquals("ERROR No Items", -1, o.getNonDiscountedPrice(), 0.001);
		
		// TC-1 4x6 Glossy Next Day Q1
		o.insertOrderItem(oi);
		o.calculateOrderPrice();
		assertEquals("4x6 Glossy Next Day Q1", 0.19, o.getDiscountedPrice(), 0.001);
		
		// TC-2 4x6 Glossy 1-Hour Q1
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("4x6 Glossy 1-Hour Q1", 2.19, o.getDiscountedPrice(), 0.001);
		
		// TC-3 4x6 Matte Next Day Q1
		oi.setMyPTime(1);
		oi.setMyFinish(2);
		o.calculateOrderPrice();
		assertEquals("4x6 Matte Next Day Q1", 0.23, o.getDiscountedPrice(), 0.001);
		
		// TC-4 4x6 Matte 1-Hour Q1
		oi.setMyPTime(2);
		oi.setMyFinish(2);
		o.calculateOrderPrice();
		assertEquals("4x6 Matte 1-Hour Q1", 2.23, o.getDiscountedPrice(), 0.001);
	
		// TC-5 5x7 Glossy Next Day Q1
		oi.setMySize(2);
		oi.setMyFinish(1);
		oi.setMyPTime(1);
		o.calculateOrderPrice();
		assertEquals("5x7 Glossy Next Day Q1", 0.39, o.getDiscountedPrice(), 0.001);
		
		// TC-6 5x7 Glossy 1-Hour Q1
		oi.setMySize(2);
		oi.setMyFinish(1);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("5x7 Glossy 1-Hour Q1", 2.39, o.getDiscountedPrice(), 0.001);
		
		// TC-7 5x7 Matte Next Day Q1
		oi.setMySize(2);
		oi.setMyFinish(2);
		oi.setMyPTime(1);
		o.calculateOrderPrice();
		assertEquals("5x7 Matte Next Day Q1", 0.45, o.getDiscountedPrice(), 0.001);
	
		// TC-8 5x7 Matte 1-Hour Q1
		oi.setMySize(2);
		oi.setMyFinish(2);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("5x7 Matte 1-Hour Q1", 2.45, o.getDiscountedPrice(), 0.001);

		// TC-9 8x10 Glossy Next Day Q1
		oi.setMySize(3);
		oi.setMyFinish(1);
		oi.setMyPTime(1);
		o.calculateOrderPrice();
		assertEquals("8x10 Glossy Next Day Q1", 0.79, o.getDiscountedPrice(), 0.001);
		
		// TC-10 8x10 Glossy 1-Hour Q1
		oi.setMySize(3);
		oi.setMyFinish(1);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("8x10 Glossy 1-Hour Q1", 2.79, o.getDiscountedPrice(), 0.001);
		
		// TC-11 8x10 Matte Next Day Q1
		oi.setMySize(3);
		oi.setMyFinish(2);
		oi.setMyPTime(1);
		o.calculateOrderPrice();
		assertEquals("8x10 Matte Next Day Q1", 0.87, o.getDiscountedPrice(), 0.001);
	
		// TC-12 8x10 Matte 1-Hour Q1
		oi.setMySize(3);
		oi.setMyFinish(2);
		oi.setMyPTime(2);
		o.calculateOrderPrice();
		assertEquals("8x10 Matte 1-Hour Q1", 2.87, o.getDiscountedPrice(), 0.001);
		
		// TC-13 Combo One
		//		4x6		Glossy	Next Day	 $0.19 	 $-   	10
		//		4x6		Matte	Next Day	 $0.19 	 $0.04 	10
		//		5x7		Glossy	Next Day	 $0.39 	 $-   	10
		//		5x7		Matte	Next Day	 $0.39 	 $0.06 	10
		//		8x10	Glossy	Next Day	 $0.79 	 $-   	10
		//		8x10	Matte	Next Day	 $0.79 	 $0.08 	10
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(1, 1, 1, 10, 1));
		o.insertOrderItem(new OrderItem(1, 2, 1, 10, 1));
		o.insertOrderItem(new OrderItem(2, 1, 1, 10, 1));
		o.insertOrderItem(new OrderItem(2, 2, 1, 10, 1));
		o.insertOrderItem(new OrderItem(3, 1, 1, 10, 1));
		o.insertOrderItem(new OrderItem(3, 2, 1, 10, 1));
		o.calculateOrderPrice();
		assertEquals("Combo One", 29.2, o.getDiscountedPrice(), 0.001);
		
		// TC-14 Combo Two
		//		4x6		Glossy	1 Hour	 $0.19 	 $-   	20
		//		4x6		Matte	1 Hour	 $0.19 	 $0.04 	20
		//		5x7		Glossy	1 Hour	 $0.39 	 $-   	20
		//		5x7		Matte	1 Hour	 $0.39 	 $0.06 	20
		//		8x10	Glossy	1 Hour	 $0.79 	 $-   	20
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(1, 1, 2, 20, 1));
		o.insertOrderItem(new OrderItem(1, 2, 2, 20, 1));
		o.insertOrderItem(new OrderItem(2, 1, 2, 20, 1));
		o.insertOrderItem(new OrderItem(2, 2, 2, 20, 1));
		o.insertOrderItem(new OrderItem(3, 1, 2, 20, 1));
		o.calculateOrderPrice();
		assertEquals("Combo Two", 41.325, o.getDiscountedPrice(), 0.001);
		
		// TC-15 Combo Three
		//		4x6		Glossy	Next Day	$0.19 	 $-   	30
		//		4x6		Glossy	1 Hour	 	$0.19 	 $-   	30
		//		4x6		Matte	Next Day	$0.19 	 $0.04 	30
		//		4x6		Matte	1 Hour	 	$0.19 	 $0.04 	10
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(1, 1, 1, 30, 1));
		o.insertOrderItem(new OrderItem(1, 1, 2, 30, 1));
		o.insertOrderItem(new OrderItem(1, 2, 1, 30, 1));
		o.insertOrderItem(new OrderItem(1, 2, 2, 10, 1));
		o.calculateOrderPrice();
		assertEquals("Combo Three", 23.1, o.getDiscountedPrice(), 0.001);

		// TC-16 Combo Four
		//		5x7	Glossy	Next Day	$0.39 	 $-   	25
		//		5x7	Glossy	1 Hour	 	$0.39 	 $-   	25
		//		5x7	Matte	Next Day	$0.39 	 $0.06 	25
		//		5x7	Matte	1 Hour	 	$0.39 	 $0.06 	25
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(2, 1, 1, 25, 1));
		o.insertOrderItem(new OrderItem(2, 1, 2, 25, 1));
		o.insertOrderItem(new OrderItem(2, 2, 1, 25, 1));
		o.insertOrderItem(new OrderItem(2, 2, 2, 25, 1));
		o.calculateOrderPrice();
		assertEquals("Combo Four", 42.275, o.getDiscountedPrice(), 0.001);
		
		// TC-17 Combo Five
		//		4x6		Glossy	1 Hour	 $0.19 	 $-   	15
		//		4x6		Matte	1 Hour	 $0.19 	 $0.04 	15
		//		5x7		Glossy	1 Hour	 $0.39 	 $-   	15
		//		5x7		Matte	1 Hour	 $0.39 	 $0.06 	15
		//		8x10	Glossy	1 Hour	 $0.79 	 $-   	15
		//		8x10	Matte	1 Hour	 $0.79 	 $0.08 	15
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(1, 1, 2, 15, 1));
		o.insertOrderItem(new OrderItem(1, 2, 2, 15, 1));
		o.insertOrderItem(new OrderItem(2, 1, 2, 15, 1));
		o.insertOrderItem(new OrderItem(2, 2, 2, 15, 1));
		o.insertOrderItem(new OrderItem(3, 1, 2, 15, 1));
		o.insertOrderItem(new OrderItem(3, 2, 2, 15, 1));
		o.calculateOrderPrice();
		assertEquals("Combo Five", 43.985, o.getDiscountedPrice(), 0.001);

		// TC-18 Combo Six
		//		4x6		Glossy	Next Day	$0.19 	 $-   	4
		//		4x6		Glossy	1 Hour	 	$0.19 	 $-   	4
		//		4x6		Matte	Next Day	$0.19 	 $0.04 	4
		//		4x6		Matte	1 Hour	 	$0.19 	 $0.04 	4
		//		5x7		Glossy	Next Day	$0.39 	 $-   	4
		//		5x7		Glossy	1 Hour	 	$0.39 	 $-   	4
		//		5x7		Matte	Next Day	$0.39 	 $0.06 	4
		//		5x7		Matte	1 Hour	 	$0.39 	 $0.06 	4
		//		8x10	Glossy	Next Day	$0.79 	 $-   	4
		//		8x10	Glossy	1 Hour	 	$0.79 	 $-   	4
		//		8x10	Matte	Next Day	$0.79 	 $0.08 	4
		//		8x10	Matte	1 Hour	 	$0.79 	 $0.08 	4
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(1, 1, 1, 4, 1));
		o.insertOrderItem(new OrderItem(1, 1, 2, 4, 1));
		o.insertOrderItem(new OrderItem(1, 2, 1, 4, 1));
		o.insertOrderItem(new OrderItem(1, 2, 2, 4, 1));
		o.insertOrderItem(new OrderItem(2, 1, 1, 4, 1));
		o.insertOrderItem(new OrderItem(2, 1, 2, 4, 1));
		o.insertOrderItem(new OrderItem(2, 2, 1, 4, 1));
		o.insertOrderItem(new OrderItem(2, 2, 2, 4, 1));
		o.insertOrderItem(new OrderItem(3, 1, 1, 4, 1));
		o.insertOrderItem(new OrderItem(3, 1, 2, 4, 1));
		o.insertOrderItem(new OrderItem(3, 2, 1, 4, 1));
		o.insertOrderItem(new OrderItem(3, 2, 2, 4, 1));
		o.calculateOrderPrice();
		assertEquals("Combo Six", 25.36, o.getDiscountedPrice(), 0.001);

		// TC-19 Combo Seven
		//		4x6		Glossy	Next Day	$0.19 	 $-   	8
		//		4x6		Glossy	1 Hour	 	$0.19 	 $-   	8
		//		4x6		Matte	Next Day	$0.19 	 $0.04 	8
		//		4x6		Matte	1 Hour	 	$0.19 	 $0.04 	8
		//		5x7		Glossy	Next Day	$0.39 	 $-   	8
		//		5x7		Glossy	1 Hour	 	$0.39 	 $-   	8
		//		5x7		Matte	Next Day	$0.39 	 $0.06 	8
		//		5x7		Matte	1 Hour	 	$0.39 	 $0.06 	8
		//		8x10	Glossy	Next Day	$0.79 	 $-   	8
		//		8x10	Glossy	1 Hour	 	$0.79 	 $-   	8
		//		8x10	Matte	Next Day	$0.79 	 $0.08 	8
		//		8x10	Matte	1 Hour	 	$0.79 	 $0.08 	8
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(1, 1, 1, 8, 1));
		o.insertOrderItem(new OrderItem(1, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(1, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(1, 2, 2, 8, 1));
		o.insertOrderItem(new OrderItem(2, 1, 1, 8, 1));
		o.insertOrderItem(new OrderItem(2, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(2, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(2, 2, 2, 8, 1));
		o.insertOrderItem(new OrderItem(3, 1, 1, 8, 1));
		o.insertOrderItem(new OrderItem(3, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(3, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(3, 2, 2, 8, 1));
		o.calculateOrderPrice();
		assertEquals("Combo Seven", 46.759, o.getDiscountedPrice(), 0.001);

		// TC-20 Combo Eight
		//		4x6		Glossy	Next Day	$0.19 	 $-   	12
		//		4x6		Glossy	1 Hour	 	$0.19 	 $-   	8
		//		4x6		Matte	Next Day	$0.19 	 $0.04 	8
		//		4x6		Matte	1 Hour	 	$0.19 	 $0.04 	8
		//		5x7		Glossy	Next Day	$0.39 	 $-   	8
		//		5x7		Glossy	1 Hour	 	$0.39 	 $-   	8
		//		5x7		Matte	Next Day	$0.39 	 $0.06 	8
		//		5x7		Matte	1 Hour	 	$0.39 	 $0.06 	8
		//		8x10	Glossy	Next Day	$0.79 	 $-   	8
		//		8x10	Glossy	1 Hour	 	$0.79 	 $-   	8
		//		8x10	Matte	Next Day	$0.79 	 $0.08 	8
		//		8x10	Matte	1 Hour	 	$0.79 	 $0.08 	8
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(1, 1, 1, 12, 1));
		o.insertOrderItem(new OrderItem(1, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(1, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(1, 2, 2, 8, 1));
		o.insertOrderItem(new OrderItem(2, 1, 1, 8, 1));
		o.insertOrderItem(new OrderItem(2, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(2, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(2, 2, 2, 8, 1));
		o.insertOrderItem(new OrderItem(3, 1, 1, 8, 1));
		o.insertOrderItem(new OrderItem(3, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(3, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(3, 2, 2, 8, 1));
		o.calculateOrderPrice();
		assertEquals("Combo Eight", 47.481, o.getDiscountedPrice(), 0.001);

		// TC-21 Combo Nine
		//		4x6		Glossy	Next Day	$0.19 	 $-   	12
		//		4x6		Glossy	1 Hour	 	$0.19 	 $-   	8
		//		4x6		Matte	Next Day	$0.19 	 $0.04 	8
		//		4x6		Matte	1 Hour	 	$0.19 	 $0.04 	8
		//		5x7		Glossy	Next Day	$0.39 	 $-   	8
		//		5x7		Glossy	1 Hour	 	$0.39 	 $-   	8
		//		5x7		Matte	Next Day	$0.39 	 $0.06 	8
		//		5x7		Matte	1 Hour	 	$0.39 	 $0.06 	8
		//		8x10	Glossy	Next Day	$0.79 	 $-   	8
		//		8x10	Glossy	1 Hour	 	$0.79 	 $-   	8
		//		8x10	Matte	Next Day	$0.79 	 $0.08 	8
		//		8x10	Matte	1 Hour	 	$0.79 	 $0.08 	9
		o.getMyItemList().clear();
		o.insertOrderItem(new OrderItem(1, 1, 1, 12, 1));
		o.insertOrderItem(new OrderItem(1, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(1, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(1, 2, 2, 8, 1));
		o.insertOrderItem(new OrderItem(2, 1, 1, 8, 1));
		o.insertOrderItem(new OrderItem(2, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(2, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(2, 2, 2, 8, 1));
		o.insertOrderItem(new OrderItem(3, 1, 1, 8, 1));
		o.insertOrderItem(new OrderItem(3, 1, 2, 8, 1));
		o.insertOrderItem(new OrderItem(3, 2, 1, 8, 1));
		o.insertOrderItem(new OrderItem(3, 2, 2, 9, 1));
		o.calculateOrderPrice();
		assertEquals("Combo Nine - ERROR TOO MANY", -1, o.getNonDiscountedPrice(), 0.001);

	}


}
